package com.lo.enums;

//自定义类型枚举
public enum EnumVip {
    ORDINARY(0,"非会员"),
    VIP(1,"会员");
    public static EnumVip getByCode(int code){
        EnumVip[] values = EnumVip.values();
        for (EnumVip value:values) {
            if (value.code==code){
                return value;
            }
        }
        return null;
    }

    //成员变量
    private int code;
    private String name;

    EnumVip(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
